CC = gcc
CFLAGS= -Wall -pedantic -g
SUBJECT1= "lcschat: Consegna frammento 1"


.PHONY: test1 consegna1 clean cleanall

test-frag1: test-frag1.o lcshash.o 
test-frag1.o: lcshash.h
lcshash.o: lcshash.h

#effettua il test
test1: test-frag1
	cp ./test1/lcshash.dat  ./.lcshash.dat
	cp ./test1/lcshash2.dat ./.lcshash2.dat
	chmod 644 ./.lcshash*
	-rm -f ./.mtrace.log
	@echo MALLOC_TRACE=$(MALLOC_TRACE)
	./test-frag1 1>./output 2>./error
	diff ./output ./test1/output.check
	mtrace ./test-frag1 ./.mtrace.log
	@echo -e "\a\n*** TEST SUPERATO! ***\n"

#effettua il test e la consegna
consegna1:
	make test1
	./gruppo-check.pl < gruppo.txt
	tar -cvf $(USER)-f1.tar ./gruppo.txt ./lcshash.c
	mpack -s $(SUBJECT1) ./$(USER)-f1.tar  susanna@di.unipi.it
	@echo -e "\a\n*** PROGETTO CONSEGNATO! ***\n"

clean:
	-rm -f *~ core 

cleanall:	
	-rm -f *.o *~ core .mtrace.log 

